package com.woniumall.util;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @auther linke
 * @create 2021-11-01 1:38
 * 阿里巴巴配置类
 */


public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118642389";// 2021000118614932

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCdRP8FZ2Qkp2fxG8Y6rjZscLwEG7rcE9xPdqasEt7yu1YDTyykUrrtkcJUDj3RwaKre54DXUK/laK8wCjadyya1YTWXFy0DpvlgUxmgjx1ZDYNmmu/bgjWTO4gTUAjKPTUFxORcs5ikTNOiRWZUVR9RvWC3sVDVWFENbPmq6eskJm/pHmtvtKPBFOVluBDXqGyrohODfM6gm2H/TMGM+oLNVD1fiMbphJw7rgNfuNZkz+SQmYbIo/cScwztFP/3v35psmxyq7rq1TXquPsY4HtYOknrhNpfkzgVgFXEw5XDaKDwYNoSbqN3WizxBFfASLptNEYs1fLeaBPo2NdWzXHAgMBAAECggEBAJjoJ2cyohw9I4M59N7C2SlP5o28BE7LhI1CGET/SAMKf1NSXF4cDaDD8gPVoOda8/T0iKpOt4IcU5Be6JmX+ydDaBce0AdEmPBoaUbVY0DjwOYy+IWzzyXEwFVppm1I+dln4l+tFtqgwBigkf5yI8p1/mhSfcq8rYgrCpHA3ZKZrbkDkin7Bgv1Yh07VnAKmTWlq+i6bpDWCqp53tIkrwWyRxJcmbIEkNeQhTxmcyFbMMEwLr74l+L1tN/8BmFI2/zVF7W5mPGuxiYDdR3QSbAEF73McQqY/e29YtlYarqwBt+cj0k/oJNPfLvQL+/vznXKUP4JvJBZ5go9GszzWtECgYEA6ykdUs6ZTLdKCYDaRVGVP3KAhcBsSPFTSIR8lF3Ift6TE0LYM3Ccx7z4NFwdfR1NyKLrtwDkIt3bWJi0Xbs62APH6etZ6bI/EebBTOO9Ba5ofTIu+X9w+UyNMAV1Yn9NvHOwVTD55iVhBbUvS3iOtOOY7sC45+323WfueCcSa68CgYEAqzTVdX2bBcnccGQH9RlKviUra53wD2muLzJB73LUjjwZt/CkRc3HoMjPHDcCKLjdd7BPZGn6AHy8UngefZXDsZYyvoOLqnMa9ALot7ZRuSHQtVRdQdyLbAii4HAyddI34hxhItCUxORr+n2MAva7RJuN0TgUTNTDNOzYPeH/ZWkCgYASs6ZdW4jdjQYaU2EIekCAVz7ZZEA4XNjev4qY0gyL6m+P7JT9IkuVpvWmVF0UAiyZdDuCxlNeYn57QUm22pkHbOWNOOZhq4dQiSV+U+5IcWJl8oPB29zENs5Tr1tyheVMw3aWj9qP7xEUPyCPw/q1cBRNiI4sA8TKPuW8MH9KiQKBgH9BiTyIfVcDISglIkkLYKQPKsQWJB7Ataj9GUdrOhTzFUbExsXf2/dl65QUSzWLm4pgcdK4dwwvqyc9g6RjUo9IjjVPv9uVLT6cfvA2w23xdZmiuKLA1J0bmj1rCAbNl54o7AadtUbYZm5NLWnyjWXEndgab/Rf3S0UsvLkbhqpAoGBAKRb4cpV83Elv4Yu32p79ZB2QVLi17tdX515ZkOgAYkFRsxQNji0EZKeN5+XkGyF9jK+vDkrWSKQqpU0YHxCrUhcFbphVl09IRnI3Qt9C+1GnRwnH7SBDvzmZiDTFWC9yM1UX0OxakdLxlk/+HF7YJQsdscVt+7QyT5nEB4SbtDv";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkpS2j3fgm1xrS6licOgT3ll32OyXmUmlB+BX0jrBmjCA5ijgmWS2O9m1emM2fRNtuZ/ZC0+Hzn+3phW6LEKjURqebSUeZmDyBer+7dZ3m2OemU70Qmk0qZrl4+NDZr4CoDVWg7XV4Kp9aQUKqRk/cOVWNG9+Hh3oLnblMTfViUkrCs2H4UFFSdAD9B6vZHzM4O9DAiUzElTGolpMbF2QdHXAn6hWXD7KXCfWt76Ko0m9uy+K3OuucWpxbrbqjf385gkKcY6yx480w07RPd9vDXWxFdbtDWEDQaepY1Ubx4u39edwJsLLWWz+8zmFbLwzyP+jtqFWYi1FvIvngxFh7wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/book/alipay/update";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/book/alipay/show";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "E:\\";


    //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}